// Header Protection
#ifndef _MANAGERASSET_H_
#define _MANAGERASSET_H_

// Include Files
#include "Definitions.h"

// Namespace
namespace IE
{
	/////////////////////////////////////////////////////////////////////////////////
	// A base class from which to derive all manager assets. A manager asset 
	//     contains all data about a certain type of asset which has been loaded.
	class ABCManagerAsset
	{
	protected:  // methods
		ABCManagerAsset() : m_uRefCount(0) { }
		virtual ~ABCManagerAsset() = 0 { }

		// Add a reference to this manager asset. This should be called whenever a 
		//     pointer to a manager asset is stored.
		void AddRef() { m_uRefCount++; }

		// Remove a reference from the manager asset. When this reaches zero, the asset 
		//     is deleted.
		void Release() { if( --m_uRefCount == 0 ) delete this; }

	private:    // data
		uint_t m_uRefCount;

	private:    // dummy definitions
		ABCManagerAsset( ABCManagerAsset const & );
		ABCManagerAsset &operator =( ABCManagerAsset const & );
	};
}

// Header Protection
#endif // _MANAGERASSET_H_
